<template>
  <div class="company-list-1">
    <div class="header">
      <div class="prefix"></div>
      <div class="header-title">任务分析</div>
    </div>
    <div class="content">
      <div class="content-box">
        <div class="content-box-label">分配任务数</div>
        <div class="content-box-value">{{ props.info?.tasksNum }}</div>
      </div>
      <div class="content-box">
        <div class="content-box-label">日均任务数</div>
        <div class="content-box-value">
          {{ (props.info?.tasksAverageDailyNum ?? 0).toFixed(2) }}
        </div>
      </div>
      <div class="content-box">
        <div class="content-box-label">任务平均耗时</div>
        <div class="content-box-value">
          {{ (props.info?.taskAveragetime ?? 0).toFixed(2) }}
        </div>
      </div>
      <div class="content-box">
        <div class="content-box-label">已完成任务数</div>
        <div class="content-box-value">{{ props.info?.taskCompletedNum }}</div>
      </div>
      <div class="content-box">
        <div class="content-box-label">超时完成任务数</div>
        <div class="content-box-value">{{ props.info?.tasktimeoutCompletedNum }}</div>
      </div>
      <div class="content-box">
        <div class="content-box-label">未完成任务数</div>
        <div class="content-box-value">{{ info?.taskUnfinishedNum }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'

const props = defineProps({
  info: {
    type: Object,
    default: () => {}
  }
})
</script>

<style scoped lang="scss">
@import '@/assets/table.css';

.company-list-1 {
  padding: 10px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  font-size: 16px;

  .header {
    width: 350px;
    height: 50px;
    display: flex;
    align-items: center;
    padding-left: 20px;

    .prefix {
      width: 8px;
      height: 15px;
      background-color: #31a7ff;
    }

    .header-title {
      padding-left: 10px;
    }
  }

  .content {
    flex: 1;
    display: flex;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;

    &-box {
      flex: 0 0 calc(33.3% - 10px);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin-bottom: 10px;

      &-label {
        color: rgba(255, 255, 255, 0.5);
      }

      &-value {
        font-size: 30px;
      }
    }
  }
}
</style>
